package cn.tedu.controller;

import cn.tedu.pojo.Student;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//接受浏览器发来的数据
@RestController
@RequestMapping("/stu")
@CrossOrigin(origins = "*")//解决跨域问题：前端与后端的IP地址不同
public class StuController {
    //接受浏览器里form里提交的数据
    @RequestMapping("/add")
    //http://localhost:8080/stu/add
    public Student add(Student s){
        System.out.println(s);
        return s;
    }
}
